package com.singleton.pattern.singleton;

/**
 * @author cc
 * @classname InnerClass
 * @description 静态内部类-延迟加载    只有通过显式调用 getInstance 方法时，才会显式装载 InnerClass 类，从而实例化 instance
 * @date 2022/4/5 19:14
 */
public class InnerClassSingleton {

    private static class InnerClass {
        private static final InnerClassSingleton SINGLETON = new InnerClassSingleton();
    }

    public static InnerClassSingleton getInstance() {
        return InnerClass.SINGLETON;
    }

    public enum Singleton {
        SINGLETON
    }

}
